<jsp:directive.include file="/jsp/includes/taglibs.jsp" />

<c:set var="commentClass" value="comment"/>
<c:set var="explodedClass" value="exploded"/>
<c:set var="previewClass" value="preview"/>

<c:if test="${ empty comment.root }">
	<c:set var="rootClass" value="comment root"/>
	<c:set var="explodedClass" value="root"/>
</c:if>


<div class="${ commentClass }" id="${ comment.id }">
	<c:if test="${ !empty comment.root }">
		<div class="${ previewClass }">
			<c:set var="comment" value="${comment}" scope="request"/>
			<jsp:include page="commentPreview.jsp"/>
		</div>
	</c:if>
	
	<div class="${ explodedClass }">
		<c:if test="${ param.id eq comment.id || empty comment.root}">
			<jsp:include page="commentBody.jsp"/>
		</c:if>
	</div>
	
	<c:if test="${ loadChildren }">
		<div class="commentChildren">
			<c:forEach items="${ comment.children }" var="comment">
				<c:set var="comment" value="${comment}" scope="request"/>
				<jsp:include page="comment.jsp"/>
			</c:forEach>
		</div>
	</c:if>
</div>